package com.wondertek.service.entity.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wondertek.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author xqs
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_file")
public class SysFilePo extends BaseEntity {

    /**
     * 源文件名
     */
    @Schema(name = "originalFilename",description = "源文件名")
    private String originalFilename;

    /**
     * 文件名
     */
    @Schema(name = "fileName",description = "文件名")
    private String fileName;

    /**
     * 扩展名
     */
    @Schema(name = "extName",description = "扩展名")
    private String extName;

    /**
     * 文件大小
     */
    @Schema(name = "fileSize",description = "文件大小")
    private String fileSize;

    /**
     * 文件url
     */
    @Schema(name = "filePath",description = "文件路径")
    private String filePath;

    /**
     * 上传开始时间
     */
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(name = "startTime",description = "上传开始时间")
    private Date startTime;

    /**
     * 上传结束时间
     */
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(name = "endTime",description = "上传结束时间")
    private Date endTime;

    /**
     * 业务类型
     */
    @Schema(name = "bizType",description = "业务类型")
    private String bizType;

    /**
     * 业务id
     */
    @Schema(name = "bizId",description = "业务id")
    private String bizId;

    /**
     * 启用 ENABLE 关闭 DISABLE
     */
    @Schema(name = "status",description = "启用 ENABLE 关闭 DISABLE")
    private String status;

    //***** 以下非数据库字段 ********

    @TableField(exist = false)
    @Schema(name = "viewUrl",description = "预览地址")
    private String viewUrl;

    @TableField(exist = false)
    @Schema(name = "downloadUrl",description = "下载地址")
    private String downloadUrl;
}
